import java.util.Objects;

 class Employee {
     private  String name;
     private  int id;
     private  String department;
     public  Employee(String name,int id,String department){
         this.name=name;
         this.id=id;
         this.department=department;
     }
    @Override
    public boolean equals(Object obj){
        if(obj==this) return true;
        if(obj==null) return false;
        if(getClass()!=obj.getClass()) return  false;
        Employee other =(Employee)  obj;
        return  id==other.id&&Objects.equals(name,other.name)&&Objects.equals(department,other.department);
    }
    @Override
    public int hashCode(){
        return Objects.hash(name,id,department);
    }
}
class Manager extends  Employee{
     private  int teamSize;
     public Manager(String name,int id,String department,int teamSize){
         super(name,id,department);
         this.teamSize=teamSize;
     }

     @Override
     public  boolean equals(Object obj){
         if(!super.equals(obj)) return false;

         Manager other=(Manager) obj;
         return teamSize==other.teamSize;
     }

    @Override
    public  int hashCode(){
         return Objects.hash(super.hashCode(),teamSize);
    }

}
 class EmployeeDemo{
     public  static  void main(String[] args) {
         Employee emp1 = new Employee("张三", 1001, "技术部");
         Employee emp2 = new Employee("张三", 1001, "技术部");

         java.util.HashMap<Employee, String> taskMap = new java.util.HashMap<>();
         Employee testEmp = new Employee("张三", 1001, "技术部");
         taskMap.put(emp1, "完成任务");
         taskMap.put(testEmp, "项目管理");
         String task = taskMap.get(emp1);
     }
}